{extend name="layouts/app"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">编辑管理员</div>
    <div class="layui-card-body">
        <form class="layui-form" method="post" action="{:url('update')}">
            <div class="layui-form-item">
                <label class="layui-form-label">登录名</label>
                <div class="layui-input-inline">
                    <input onfocus="this.type='text'" name="username" value="{$admin->username}" lay-verify="required" autocomplete="off" placeholder="登录名" class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">真实姓名</label>
                <div class="layui-input-inline">
                    <input onfocus="this.type='text'" name="nickname" value="{$admin->nickname}" autocomplete="off" placeholder="真实姓名" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="1" title="正常" {eq name="$admin->status" value="1" }checked{/eq} >
                    <input type="radio" name="status" value="0" title="禁用" {eq name="$admin->status" value="0" }checked{/eq} >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色</label>
                <div class="layui-input-block">
                    {volist name="$authGroups" id="authGroups"}
                        <input type="checkbox" name="role[]" value="{$authGroups->id}" title="{$authGroups->title}" {eq name="$authGroups->checked" value="1" }checked{/eq}>
                    {/volist}
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$admin->id}">
                    <button class="layui-btn" lay-submit lay-filter="formSubmit">立即提交</button>
                    <button class="layui-btn layui-btn-normal" type="button" onclick="javascript:history.back(-1);">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}